package redis;

import redis.clients.jedis.*;

public class TestSingleRedis {
	//1 单独连接1台redis服务器
	private static Jedis jedis;
	//2 主从、哨兵 使用 shard
	private static ShardedJedis shard;
	//3 连接池
	private static ShardedJedisPool pool;

	public static void main(String[] args) {
		JedisPoolConfig config = new JedisPoolConfig();
		JedisPool pool;
		pool = new JedisPool(config, "154.135.80.5",6379);


		Jedis redis = pool.getResource();
		//redis.select(7);
		//redis.connect();
		//System.out.println(redis.set("OA_MAIL_TREE_ALLFY_DEP",json));
//		Set<String> keys = redis.keys("OA_MAIL_TREE_ALLFY_DEP");
//		Iterator<String> iterator = keys.iterator();
//		while (iterator.hasNext()) {
//			String str = iterator.next();
//			System.out.println(str);
//		}
	}
}
